<!DOCTYPE html>
<html>
	<head>
		<title>format value</title>
		<link type='text/css' href='./css/assert.css' rel='stylesheet'/>
	</head>
	<body>
		<script type='text/javascript' src='./scripts/assert.js'></script>
		<script type='text/javascript' src='./scripts/formatValue.js'></script>
		<script>
			window.onload = function(){
				var value = 12;
				assert( formatValue( value ) == value, formatValue ( value ) + ' is equal to ' + value );
				value = 123;
				assert( formatValue( value ) == value, formatValue( value ) + ' is equal to ' + value );
				value = 1234;
				assert( formatValue( value ) == '1,234', formatValue( value ) + ' is equal to 1,234' );
				value = 123456789;
				assert( formatValue( value ) == '123,456,789', formatValue( value ) + ' is equal to 123,456,789' );
				value = 12345678;
				assert( formatValue( value ) == '12,345,678', formatValue( value ) + ' is equal to 12,345,678' );
				value = 123456789012345;
				assert( formatValue( value ) == '123,456,789,012,345', formatValue( value ) + ' is equal to 123,456,789,012,345' );
				value = 12.3;
				assert( formatValue( value ) == value, formatValue( value ) + ' is equal to 12.3' );
				value = -1234567.89;
				assert( formatValue( value ) == '-1,234,567.89', formatValue( value ) + ' is equal to -1,234,567.89' );
				assert( formatValue( undefined ) === undefined, ' is undefined' );
				assert( formatValue( null ) === null, ' is still null' );
				assert( formatValue( 'formatValue' ) === 'formatValue', ' it is still formatValue' );
				value = 1234567.890123;
				assert( formatValue( value ) === '1,234,567.890123','it is 1,234,567.890123' );
			}
		</script>
	</body>
</html>
